package com.autobet.services;

import com.alibaba.fastjson.JSONObject;

/**
 * 车数据变更开关
 * Created by yangd on 2017-10-16.
 */
public class SetCarStatus {

    public static boolean dx1 = false;
    public static boolean dx2 = false;
    public static boolean dx3 = false;
    public static boolean dx4 = false;
    public static boolean dx5 = false;
    public static boolean dx6 = false;
    public static boolean dx7 = false;
    public static boolean dx8 = false;
    public static boolean dx9 = false;
    public static boolean dx10 = false;

    public static boolean ds1 = false;
    public static boolean ds2 = false;
    public static boolean ds3 = false;
    public static boolean ds4 = false;
    public static boolean ds5 = false;
    public static boolean ds6 = false;
    public static boolean ds7 = false;
    public static boolean ds8 = false;
    public static boolean ds9 = false;
    public static boolean ds10 = false;


    public static boolean isDx1() {
        return dx1;
    }

    public static void setDx1(boolean dx1) {
        SetCarStatus.dx1 = dx1;
    }

    public static boolean isDx2() {
        return dx2;
    }

    public static void setDx2(boolean dx2) {
        SetCarStatus.dx2 = dx2;
    }

    public static boolean isDx3() {
        return dx3;
    }

    public static void setDx3(boolean dx3) {
        SetCarStatus.dx3 = dx3;
    }

    public static boolean isDx4() {
        return dx4;
    }

    public static void setDx4(boolean dx4) {
        SetCarStatus.dx4 = dx4;
    }

    public static boolean isDx5() {
        return dx5;
    }

    public static void setDx5(boolean dx5) {
        SetCarStatus.dx5 = dx5;
    }

    public static boolean isDx6() {
        return dx6;
    }

    public static void setDx6(boolean dx6) {
        SetCarStatus.dx6 = dx6;
    }

    public static boolean isDx7() {
        return dx7;
    }

    public static void setDx7(boolean dx7) {
        SetCarStatus.dx7 = dx7;
    }

    public static boolean isDx8() {
        return dx8;
    }

    public static void setDx8(boolean dx8) {
        SetCarStatus.dx8 = dx8;
    }

    public static boolean isDx9() {
        return dx9;
    }

    public static void setDx9(boolean dx9) {
        SetCarStatus.dx9 = dx9;
    }

    public static boolean isDx10() {
        return dx10;
    }

    public static void setDx10(boolean dx10) {
        SetCarStatus.dx10 = dx10;
    }

    public static boolean isDs1() {
        return ds1;
    }

    public static void setDs1(boolean ds1) {
        SetCarStatus.ds1 = ds1;
    }

    public static boolean isDs2() {
        return ds2;
    }

    public static void setDs2(boolean ds2) {
        SetCarStatus.ds2 = ds2;
    }

    public static boolean isDs3() {
        return ds3;
    }

    public static void setDs3(boolean ds3) {
        SetCarStatus.ds3 = ds3;
    }

    public static boolean isDs4() {
        return ds4;
    }

    public static void setDs4(boolean ds4) {
        SetCarStatus.ds4 = ds4;
    }

    public static boolean isDs5() {
        return ds5;
    }

    public static void setDs5(boolean ds5) {
        SetCarStatus.ds5 = ds5;
    }

    public static boolean isDs6() {
        return ds6;
    }

    public static void setDs6(boolean ds6) {
        SetCarStatus.ds6 = ds6;
    }

    public static boolean isDs7() {
        return ds7;
    }

    public static void setDs7(boolean ds7) {
        SetCarStatus.ds7 = ds7;
    }

    public static boolean isDs8() {
        return ds8;
    }

    public static void setDs8(boolean ds8) {
        SetCarStatus.ds8 = ds8;
    }

    public static boolean isDs9() {
        return ds9;
    }

    public static void setDs9(boolean ds9) {
        SetCarStatus.ds9 = ds9;
    }

    public static boolean isDs10() {
        return ds10;
    }

    public static void setDs10(boolean ds10) {
        SetCarStatus.ds10 = ds10;
    }


    public static boolean getCarStatus(String type , String NO){

        boolean carStatus = true;
        if( "dx".equals(type) ){

            if( "1".equals(NO)){
                carStatus = dx1;
            }else if ( "2".equals(NO)){
                carStatus = dx2;
            }else if ( "3".equals(NO)){
                carStatus = dx3;
            }else if ( "4".equals(NO)){
                carStatus = dx4;
            }else if ( "5".equals(NO)){
                carStatus = dx5;
            }else if ( "6".equals(NO)){
                carStatus = dx6;
            }else if ( "7".equals(NO)){
                carStatus = dx7;
            }else if ( "8".equals(NO)){
                carStatus = dx8;
            }else if ( "9".equals(NO)){
                carStatus = dx9;
            }else if ( "10".equals(NO)){
                carStatus = dx10;
            }

        }else if ( "ds".equals(type) ){
            if( "1".equals(NO)){
                carStatus = ds1;
            }else if ( "2".equals(NO)){
                carStatus = ds2;
            }else if ( "3".equals(NO)){
                carStatus = ds3;
            }else if ( "4".equals(NO)){
                carStatus = ds4;
            }else if ( "5".equals(NO)){
                carStatus = ds5;
            }else if ( "6".equals(NO)){
                carStatus = ds6;
            }else if ( "7".equals(NO)){
                carStatus = ds7;
            }else if ( "8".equals(NO)){
                carStatus = ds8;
            }else if ( "9".equals(NO)){
                carStatus = ds9;
            }else if ( "10".equals(NO)){
                carStatus = ds10;
            }
        }
        return carStatus;
    }


    public static void setCarStatus(String type , String NO , boolean carStatus){

        if( "dx".equals(type) ){

            if( "1".equals(NO)){
                dx1 = carStatus;
            }else if ( "2".equals(NO)){
                dx2 = carStatus;
            }else if ( "3".equals(NO)){
                dx3 = carStatus;
            }else if ( "4".equals(NO)){
                dx4 = carStatus;
            }else if ( "5".equals(NO)){
                dx5 = carStatus;
            }else if ( "6".equals(NO)){
                dx6 = carStatus;
            }else if ( "7".equals(NO)){
                dx7 = carStatus;
            }else if ( "8".equals(NO)){
                dx8 = carStatus;
            }else if ( "9".equals(NO)){
                dx9 = carStatus;
            }else if ( "10".equals(NO)){
                dx10 = carStatus;
            }


        }else if ( "ds".equals(type) ){

            if( "1".equals(NO)){
                ds1 = carStatus;
            }else if ( "2".equals(NO)){
                ds2 = carStatus;
            }else if ( "3".equals(NO)){
                ds3 = carStatus;
            }else if ( "4".equals(NO)){
                ds4 = carStatus;
            }else if ( "5".equals(NO)){
                ds5 = carStatus;
            }else if ( "6".equals(NO)){
                ds6 = carStatus;
            }else if ( "7".equals(NO)){
                ds7 = carStatus;
            }else if ( "8".equals(NO)){
                ds8 = carStatus;
            }else if ( "9".equals(NO)){
                ds9 = carStatus;
            }else if ( "10".equals(NO)){
                ds10 = carStatus;
            }
        }
    }

    public static JSONObject getCarStatusAll(){

        JSONObject jsonObject = new JSONObject();
        jsonObject.put("dx1",dx1);
        jsonObject.put("dx2",dx2);
        jsonObject.put("dx3",dx3);
        jsonObject.put("dx4",dx4);
        jsonObject.put("dx5",dx5);
        jsonObject.put("dx6",dx6);
        jsonObject.put("dx7",dx7);
        jsonObject.put("dx8",dx8);
        jsonObject.put("dx9",dx9);
        jsonObject.put("dx10",dx10);
        jsonObject.put("ds1",ds1);
        jsonObject.put("ds2",ds2);
        jsonObject.put("ds3",ds3);
        jsonObject.put("ds4",ds4);
        jsonObject.put("ds5",ds5);
        jsonObject.put("ds6",ds6);
        jsonObject.put("ds7",ds7);
        jsonObject.put("ds8",ds8);
        jsonObject.put("ds9",ds9);
        jsonObject.put("ds10",ds10);

        return jsonObject;

    }
}
